package com.zhoukx.observer.improve;

/**
 * @ClassName Client
 * @Description:
 * @Author zhoukx
 * @Date 2020/8/17
 **/
public class Client {
    public static void main(String[] args) {
        // 创建一个weatherData
        WeatherData weatherData = new WeatherData();
        // 创建一个观察者
        CureentConditions cureentConditions = new CureentConditions();
        BaiduSite baiduSite = new BaiduSite();
        // 注册到weatherData
        weatherData.registerObserver(cureentConditions);
        weatherData.registerObserver(baiduSite);
        //测试
        System.out.println("通知各个注册的观察者，看看信息");
        weatherData.setData(10f,100f,30f);
        weatherData.removeObserver(baiduSite);
    }
}
